<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:tiles="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8"/>
    <title tiles:fragment="title">新建入库单</title>

    <link href="../../../static/css/all.css" rel="stylesheet" type="text/css"/>
    <script src="../../../static/js/main.js"></script>
</head>

<body>

<div class="content" th:fragment="content" tiles:fragment="content">
    <div class="content-nav">
        <div class="titleNav">
            <div class="title_nav title_nav_Now">
                <a>新建入库单</a>
            </div>
        </div>
    </div>

    <div class="content-function">
        <div class="myDivBt">
            <a href="#" onclick="jumpTo('/storage/add/additemajax')">添加物品</a>
        </div>
    </div>

    <div class="content-result myTable myInput">
        <caption>
            入库单编号：<p th:text="${session.storageForm.inStorageId}"></p>
        </caption>
        <table id="new_storage_table">
            <thead>
            <tr>
                <th>物品条形码</th>
                <th>入库数量</th>
                <th>入库价格</th>
                <th>发票代码</th>
                <th>详情</th>
                <th>删除</th>
            </tr>
            </thead>

            <tbody>
            <tr th:if="${session.storageForm.itemForms.isEmpty()}">
                <td colspan="6ssssssss">入库单中没有物品，请添加</td>
            </tr>
            <tr th:if="${session.storageForm != null}"
                th:each="itemForm:${session.storageForm.itemForms}"
                th:id="${itemForm.itemCode}">
                <td th:text="${itemForm.itemCode}"></td>
                <td th:text="${itemForm.itemCount}"></td>
                <td th:text="${itemForm.itemPrice}"></td>
                <td th:text="${itemForm.billCode}"></td>
                <td class="myTable-operation-info icon-info-circle"
                    th:onclick="'javascript:openPop_storageItemDetails(\''+${itemForm}+'\')'">
                </td>
                <td class="myTable-operation-warning icon-trash"
                    th:onclick="'javascript:deleteStroageItem(\''+${itemForm.itemCode}+'\',1)'">
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="3">
                    <button class="myInput-danger" onclick="deleteAll()">取消</button>
                </td>
                <td colspan="3">
                    <!--todo-->
                    <button onclick="storage_submit()">提交</button>
                    <!--<div class="myDivBt">-->
                        <!--<a href="../history.html" th:href="@{/storage/add/submit}">提交</a>-->
                    <!--</div>-->
                </td>
            </tr>
            </tfoot>
        </table>
    </div>

    <div class="pop-bg">
        <div class="pop pop-details myInfoList myInput">
            <div class="pop-close">
                <div class="close_button" onclick="closePop()">
                    <div class="close_button-icon"></div>
                </div>
            </div>
            <form action="additem.html" method="get">
                <ul>
                    <li>
                        <label>
                            <div class="name">
                                物品名称：
                            </div>
                            <div class="value">
                                <input type="text" name="itemName" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                物品类别：
                            </div>
                            <div class="value">
                                <input type="text" name="itemCategory" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                库存数量：
                            </div>
                            <div class="value">
                                <input type="text" name="itemCount" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                物品单价：
                            </div>
                            <div class="value">
                                <input type="text" name="itemPrice" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                物品规格：
                            </div>
                            <div class="value">
                                <input type="text" name="itemSpec" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                生产厂商：
                            </div>
                            <div class="value">
                                <input type="text" name="itemSpec" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                入库数量：
                            </div>
                            <div class="value">
                                <input type="text" name="itemCount" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                此次入库单价：
                            </div>
                            <div class="value">
                                <input type="text" name="itemPrice" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                发票代码：
                            </div>
                            <div class="value">
                                <input type="text" name="billCode" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <div class="name">
                                入库库位：
                            </div>
                            <div class="value">
                                <input type="text" name="itemSlot" readonly="readonly"/>
                            </div>
                        </label>
                    </li>
                </ul>
            </form>
        </div>
    </div>

</div>
</body>
</html>